package client_controllers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import client_gui.CampaignReportsGUI;
import client_gui.ClassifyProductGUI;
import client_gui.CustomerReportsGUI;
import client_gui.DefineCategoryGUI;
import client_gui.DefineTypeGUI;
import client_gui.InitiateMarketingGUI;
import client_gui.MaintainAreaGUI;
import client_gui.MarketingManagerGUI;

public class MarketingManagerController extends MarketingEmployeeController {
	/**
	 * @class MarketingEmployeeController allows communications between marketing employees and DB via system.
	 * 
	 * @param MarketingManagerGUI links to GUI.
	 * @param EmployeeLoginController checks for manager authorization.
	 */

	private MarketingManagerGUI mmg;
	private EmployeeLoginController elc;
	private MarketingManagerController mmc;
	
	
public MarketingManagerController(MarketingManagerGUI mmg,EmployeeLoginController elc){
	super(mmg,elc);
	this.elc=elc;
	this.mmg=mmg;
	this.elc=elc;
	this.mmc=this;
	this.mmg.getBtnCampaignReports().addActionListener(new CampaignReportsListener());
	this.mmg.getBtnCustomerReports().addActionListener(new CustomerReportsListener());
	this.mmg.getBtnDefineCategory().addActionListener(new DefineCategoryListener());
	this.mmg.getBtnDefineType().addActionListener(new DefineTypeListener());
	this.mmg.getBtnMaintainArea().addActionListener(new MaintainAreaListener());
	mmg.getBtnClassifyProductTo().addActionListener(new ClassifyProductListener());
	mmg.getBtnInitiateMarketingCampaign().addActionListener(new InitiateMarketingListener());
	/*
	mmg.setBtnDefineCategoryLis(new DefineCategoryListener());
	
	mmg.setBtnDefineTypeLis(new DefineTypeListener());
	mmg.setBtnMaintainAreaLis(new MaintainAreaListener());
    */   	
}

public class CampaignReportsListener implements ActionListener{
	public void actionPerformed(ActionEvent ev){
		mmg.setVisible(false);	
		CampaignReportsGUI cpg = new CampaignReportsGUI(mmc,elc);
	}
}
	
	public class ClassifyProductListener implements ActionListener{
		public void actionPerformed(ActionEvent ev){
			mmg.setVisible(false);	
			ClassifyProductGUI cpg = new ClassifyProductGUI(mmc,elc);
		}
}

	public class CustomerReportsListener implements ActionListener{
		public void actionPerformed(ActionEvent ev){
			mmg.setVisible(false);	
			CustomerReportsGUI crg = new CustomerReportsGUI(mmc,elc);
	}
}

	public class DefineCategoryListener implements ActionListener{
		public void actionPerformed(ActionEvent ev){
			mmg.setVisible(false);	
			DefineCategoryGUI dcg = new DefineCategoryGUI(mmc,elc);

	}
}
	
	public class InitiateMarketingListener implements ActionListener{
		public void actionPerformed(ActionEvent ev){
			mmg.setVisible(false);	
			InitiateMarketingGUI img = new InitiateMarketingGUI(mmc,elc);
	}
}

public class DefineTypeListener implements ActionListener{
	public void actionPerformed(ActionEvent ev){
		mmg.setVisible(false);	
		DefineTypeGUI dtg = new DefineTypeGUI(mmc,elc);
}
}

public class MaintainAreaListener implements ActionListener{
	public void actionPerformed(ActionEvent ev){
		mmg.setVisible(false);	
		MaintainAreaGUI dtg = new MaintainAreaGUI(mmc,elc);
}
}

public MarketingManagerGUI getMmg() {
	return mmg;
}

public void setMmg(MarketingManagerGUI mmg) {
	this.mmg = mmg;
}

public EmployeeLoginController getElc() {
	return elc;
}

public void setElc(EmployeeLoginController elc) {
	this.elc = elc;
}


}
